/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.uccart_project.model;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author KNO
 */
@Entity
@Table(name = "titulo")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Titulo.findAll", query = "SELECT t FROM Titulo t"),
    @NamedQuery(name = "Titulo.findByTitTomo", query = "SELECT t FROM Titulo t WHERE t.titTomo = :titTomo"),
    @NamedQuery(name = "Titulo.findByTitFolio", query = "SELECT t FROM Titulo t WHERE t.titFolio = :titFolio"),
    @NamedQuery(name = "Titulo.findByTitAsiento", query = "SELECT t FROM Titulo t WHERE t.titAsiento = :titAsiento"),
    @NamedQuery(name = "Titulo.findByTitCodigo", query = "SELECT t FROM Titulo t WHERE t.titCodigo = :titCodigo")})
public class Titulo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Basic(optional = false)
    @Column(name = "tit_tomo")
    private int titTomo;
    @Basic(optional = false)
    @Column(name = "tit_folio")
    private int titFolio;
    @Basic(optional = false)
    @Column(name = "tit_asiento")
    private int titAsiento;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "tit_codigo")
    private Integer titCodigo;
    @OneToMany(mappedBy = "estCodtitulo")
    private List<Estudiante> estudianteList;

    public Titulo() {
    }

    public Titulo(Integer titCodigo) {
        this.titCodigo = titCodigo;
    }

    public Titulo(Integer titCodigo, int titTomo, int titFolio, int titAsiento) {
        this.titCodigo = titCodigo;
        this.titTomo = titTomo;
        this.titFolio = titFolio;
        this.titAsiento = titAsiento;
    }

    public int getTitTomo() {
        return titTomo;
    }

    public void setTitTomo(int titTomo) {
        this.titTomo = titTomo;
    }

    public int getTitFolio() {
        return titFolio;
    }

    public void setTitFolio(int titFolio) {
        this.titFolio = titFolio;
    }

    public int getTitAsiento() {
        return titAsiento;
    }

    public void setTitAsiento(int titAsiento) {
        this.titAsiento = titAsiento;
    }

    public Integer getTitCodigo() {
        return titCodigo;
    }

    public void setTitCodigo(Integer titCodigo) {
        this.titCodigo = titCodigo;
    }

    @XmlTransient
    public List<Estudiante> getEstudianteList() {
        return estudianteList;
    }

    public void setEstudianteList(List<Estudiante> estudianteList) {
        this.estudianteList = estudianteList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (titCodigo != null ? titCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Titulo)) {
            return false;
        }
        Titulo other = (Titulo) object;
        if ((this.titCodigo == null && other.titCodigo != null) || (this.titCodigo != null && !this.titCodigo.equals(other.titCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.uccart_project.model.Titulo[ titCodigo=" + titCodigo + " ]";
    }
    
}
